// <copyright>
// Copyright (C) 2005 Microsoft Corporation.
// </copyright>
// <author>
// Ted R. Heng
// </author>
// <creationdate>
// Wednesday, May 12, 2004, 5:00:25 PM
// </creationdate>
namespace DevelopStudio.Basic
{
    #region Using directives
    using System.Diagnostics.CodeAnalysis;
    using System.Drawing;
    using System.Windows.Forms;
    using DevelopStudio.Control.Commit;
    #endregion

    /// <summary>
    /// Standard wizard settings, such as, default wizard size, margins, etc.,
    /// internally used by the WizardFramework.
    /// </summary>
    [System.Runtime.InteropServices.ComVisible(false)]
    internal static class WizardSettings
    {
        private static Font _environmentFont = SystemFonts.MenuFont;
        private static Font _fontRegular = new Font(SystemFonts.MenuFont, FontStyle.Regular);
        private static Font _fontItalic = new Font(SystemFonts.MenuFont, FontStyle.Italic);
        private static Font _fontBold = new Font(SystemFonts.MenuFont, FontStyle.Bold);
        private static Font _fontUnderline = new Font(SystemFonts.MenuFont, FontStyle.Underline);

        public static int FormWidthStandard
        {
            get
            {
                return 500;
            }
        }

        public static int FormHeightStandard
        {
            get
            {
                return 347;
            }
        }

        public static int FormWidthWithOrientationPanel
        {
            get
            {
                if (System.Windows.Forms.SystemInformation.HighContrast)
                {
                    return 800;
                }
                return 650;
            }
        }

        public static int FormHeightWithOrientationPanel
        {
            get
            {
                return 347;
            }
        }

        public static int FormMinimumWidth
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.FormMinimumWidth")]
            get
            {
                if (System.Windows.Forms.SystemInformation.HighContrast)
                {
                    return 730;
                }
                return 580;
            }
        }

        public static int OrientationPanelWidth
        {
            get
            {
                return 150;
            }
        }

        public static int OrientationPanelMarginTop
        {
            get
            {
                return 12;
            }
        }

        public static int OrientationPanelMarginBottom
        {
            get
            {
                return 12;
            }
        }

        public static int OrientationPanelStepHeight
        {
            get
            {
                return 18;
            }
        }

        public static int OrientationPanelStepMinimumHeight
        {
            get
            {
                return 18;
            }
        }

        public static int OrientationPanelStepSeparator
        {
            get
            {
                return 4;
            }
        }

        public static int OrientationPanelStepMarginLeft
        {
            get
            {
                return 10;
            }
        }

        public static int OrientationPanelStepMarginTop
        {
            get
            {
                return 0;
            }
        }

        public static int OrientationPanelStepMarginRight
        {
            get
            {
                return 10;
            }
        }

        public static int OrientationPanelStepMarginBottom
        {
            get
            {
                return 0;
            }
        }

//--------------------------------------------------------------------------------------------------
//  BuildLunaDefaultColorTable()
//
//  Build a VSColor table that's designed for Windows XP's default theme (Luna)
//  with the default blue color scheme.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = PALETTERGB(241,239,226);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = PALETTERGB(000,000,000);

//--------------------------------------------------------------------------------------------------
//  BuildLunaMetallicColorTable()
//
//  Build a VSColor table that's designed for Windows XP's default theme (Luna)
//  with the optional metallic color scheme.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = PALETTERGB(241,239,226);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = PALETTERGB(000,000,000);

//--------------------------------------------------------------------------------------------------
//  BuildLunaOliveColorTable()
//
//  Build a VSColor table that's designed for Windows XP's default theme (Luna)
//  with the optional olive color scheme.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = PALETTERGB(241,239,226);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = PALETTERGB(000,000,000);

//--------------------------------------------------------------------------------------------------
//  BuildUnrecognizedThemeColorTable()
//
//  Build a VSColor table that compliments the current theme from known system
//  color relationships. This color table will allow bevels, gradients, stripes,
//  and will use a large number of different colors. This is the color table
//  that will be used under Windows XP when an unknown theme is applied
//  through a 3rd party application like Style XP, Window Blinds, Schemer, etc.
//
//  This color table will occasionally blend two or three colors together from
//  known relationships, ususally those which derive from COLOR_WINDOW, to
//  create a larger palette.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = GetSysColor(COLOR_BTNHIGHLIGHT);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = GetSysColor(COLOR_BTNTEXT);

//--------------------------------------------------------------------------------------------------
//  BuildThemesInactiveColorTable()
//
//  Build a VSColor table that uses a medium number of different colors but
//  doesn't allow bevels, gradients, stripes, or other theme elements. This is
//  the color table that will be used when running under Windows 2000 and
//  Windows .Net Server, or when themes are turned off.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = GetSysColor(COLOR_BTNHIGHLIGHT);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = GetSysColor(COLOR_BTNTEXT);

//--------------------------------------------------------------------------------------------------
//  BuildAccessibleColorTable()
//
//  Build a VSColor table that's optimized for high contrast accessibile scenarios.
//  In this theme we're only working with a small number of colors.
//
//  Please keep the below list alphabetically sorted!
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = GetSysColor(COLOR_BTNFACE);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = GetSysColor(COLOR_BTNTEXT);

//--------------------------------------------------------------------------------------------------
//  BuildLunaDebugColorTable()
//
//  Build a VSColor table to help with debugging.
//
//  PALETTERGB(200,000,200) is bright pink
//  PALETTERGB(100,000,140) is deep purple
//  PALETTERGB(255,255,000) is bright yellow
//  PALETTERGB(000,255,000) is bright green
//
//  Please keep the below list alphabetically sorted!
//
//--------------------------------------------------------------------------------------------------
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_BACKGROUND-1] = 	PALETTERGB(200,000,200);
//    gdwVSColorPalRGB[0-VSCOLOR_WIZARD_ORIENTATIONPANEL_TEXT-1] = PALETTERGB(100,000,140);

        public static Color OrientationPanelBackgroundColorSelected
        {
            get
            {
                return SystemColors.Highlight;
            }
        }

        public static Color OrientationPanelBackgroundColorNormal
        {
            get
            {
                if (System.Windows.Forms.SystemInformation.HighContrast)
                {
                    return SystemColors.ButtonFace;
                }
                else
                {
                    return SystemColors.ButtonHighlight;
                }
            }
        }

        public static Color OrientationPanelForegroundColor
        {
            get
            {
                return SystemColors.ControlText;	// no such thing as COLOR_BTNTEXT
            }
        }

        public static Color OrientationPanelForegroundColorSelected
        {
            get
            {
                return SystemColors.HighlightText;
            }
        }

        public static int OrientationPanelPixelsPerIndentation
        {
            get
            {
                return 16;
            }
        }

        public static int ButtonBarMarginTop
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.ButtonBarMarginTop")]
            get
            {
                return 12;
            }
        }

        public static int SummaryIndentationTwips
        {
            get
            {
                return 288;
            }
        }

        public static Font EnvironmentFont
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.EnvironmentFont")]
            get
            {
                return _environmentFont;
            }
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.EnvironmentFont")]
            set
            {
                _environmentFont = value;
            }
        }

        public static void CreateFonts(CommitForm wizard)
        {
            wizard.GetEnvironmentFont(ref _environmentFont);
            _fontRegular = new Font(_environmentFont, FontStyle.Regular);
			_fontItalic = new Font(_environmentFont, _environmentFont.Style | FontStyle.Italic);
			_fontBold = new Font(_environmentFont, _environmentFont.Style | FontStyle.Bold);
			_fontUnderline = new Font(_environmentFont, _environmentFont.Style | FontStyle.Underline);
		}

        public static Font FontRegular
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.FontRegular")]
            get
            {
                return _fontRegular;
            }
        }

        public static Font FontItalic
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.FontItalic")]
            get
            {
                return _fontItalic;
            }
        }

        public static Font FontUnderlined
        {
            [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.FontUnderlined")]
            get
            {
                return _fontUnderline;
            }
        }

        public static void InitFontRegular(Control ctrl)
        {
            ctrl.Font = _fontRegular;
        }

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.ConfigurationManagement.AdminConsole.WizardFramework.WizardSettings.InitFontItalic")]
        public static void InitFontItalic(Control ctrl)
        {
            ctrl.Font = _fontItalic;
        }

        public static void InitFontBold(Control ctrl)
        {
            ctrl.Font = _fontBold;
        }

        public static void InitFontUnderlined(Control ctrl)
        {
            ctrl.Font = _fontUnderline;
        }
    }
}
